package com.lch.thread.vip;

/**
 * @author: liuchenhui
 * @create: 2019-05-13 22:04
 **/
public class SyncDemo implements Runnable {

    Object object;

    public SyncDemo(Object object) {
        this.object = object;
    }

    public void inic() {
        synchronized (object) {
            System.out.println();
        }
    }

    @Override
    public void run() {
        inic();
    }

    public static void main(String[] args) {
        Object oject = new Object();
        new Thread(new SyncDemo(oject)).start();
        new Thread(new SyncDemo(oject)).start();
    }
}
